package com.xb.demo.utils;


import com.alibaba.fastjson.JSONArray;

/**
 * @ClassName IPparseUtils
 * @Description TODO
 * @Author YLZ
 * @Date 2018/7/23 16:29
 * @Version 1.0
 **/
public class IPparseUtils {

    public static JSONArray getArea(String ip){
        IpSerachUtils finder = IpSerachUtils.getInstance();
        String value = finder.Get(ip);
        String[] rs = {"","","","","","","","","","",""};
        String[] result = value.split("\\|");
        System.arraycopy(result,0,rs,0,result.length);
        JSONArray json = (JSONArray) JSONArray.toJSON(rs);
        return json;
    }
//
//    public static void main(String[] args) {
//        JSONArray a = IPparseUtils.getArea("113.210.186.31");
//        System.out.println(a);
//    }
}
